package com.spring.bean.aware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;

/**
 * @ClassName: TestAware
 * @Author: suncx
 * @CreateDate: 2020-04-12 14:26
 * @Description:
 */
public class TestAware implements BeanFactoryAware {
    private BeanFactory beanFactory;
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        this.beanFactory = beanFactory;
    }

    public void testAware() {
        MyBeanInitTest myBeanTest = (MyBeanInitTest)beanFactory.getBean("myBeanInitTest");
        System.out.println(myBeanTest.toString());
    }
}
